package com.twu.biblioteca;

import java.util.Scanner;

public class ConsoleApp {
    public static void main(String[] args) {
        BibliotecaApp biblio = new BibliotecaApp();

        // will be changed to database later

        User user1 = new User("111-1111", "password");
        User user2 = new User("111-1112", "password");
        User user3 = new User("111-1113", "password");

        biblio.addUser(user1);
        biblio.addUser(user2);
        biblio.addUser(user3);

        Book book1 = new Book("Book One", true);
        Book book2 = new Book("Book Two", false);
        Book book3 = new Book("Book Three", true);

        biblio.addBook(book1);
        biblio.addBook(book2);
        biblio.addBook(book3);

        Movie movie1 = new Movie("Movie 1", 1999, "Director one", 0);
        Movie movie2 = new Movie("Movie 2", 2000, "Director two", 1);
        Movie movie3 = new Movie("Movie 3", 2001, "Director three");
        Movie movie4 = new Movie("Movie 4", 2004, "Director", 10);
        Movie movie5 = new Movie("Movie 5", 2001, "Director", 8);
        Movie movie6 = new Movie("Movie 6", 2001, "Director", 7);
        Movie movie7 = new Movie("Movie 7", 2001, "Director");
        Movie movie8 = new Movie("Movie 8", 2001, "Director");
        Movie movie9 = new Movie("Movie 9", 2001, "Director");
        Movie movie10 = new Movie("Movie 10", 2012, "Director");
        Movie movie11 = new Movie("Movie 11", 2011, "Director");
        Movie movie12 = new Movie("Movie 12", 2009, "Director");
        Movie movie13 = new Movie("Movie 13", 2001, "Director");
        Movie movie14 = new Movie("Movie 14", 2001, "Director");
        Movie movie15 = new Movie("Movie 15", 2001, "Director");

        biblio.addMovie(movie1);
        biblio.addMovie(movie2);
        biblio.addMovie(movie3);
        biblio.addMovie(movie4);
        biblio.addMovie(movie5);
        biblio.addMovie(movie6);
        biblio.addMovie(movie7);
        biblio.addMovie(movie8);
        biblio.addMovie(movie9);
        biblio.addMovie(movie10);
        biblio.addMovie(movie11);
        biblio.addMovie(movie12);
        biblio.addMovie(movie13);
        biblio.addMovie(movie14);
        biblio.addMovie(movie15);


        //

        ReserveBooksState.instance.setBibliotecaApp(biblio);
        ListBooksState.instance.setBibliotecaApp(biblio);
        ListMoviesState.instance.setBibliotecaApp(biblio);
        LoginState.instance.setBibliotecaApp(biblio);

        System.out.println("Welcome to our wonderful Biblioteca!!!!!");

        Scanner input = new Scanner(System.in);
        State state = MenuState.instance;
        do {
            System.out.println(state.getMessage());
            state = state.change(input.next());

        }
        while (true);



    }
}
